<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
    <title>亿人宝 - 个人中心</title>
    <meta content="" name="keywords"/>
    <meta content="" name="description"/>
    <link rel="stylesheet" th:href="@{/css/common.css}"/>
    <link rel="stylesheet" th:href="@{/css/user.css}" type="text/css"/>
    <script th:src="@{/script/jquery.min.js}" type="text/javascript"></script>
    <script th:src="@{/script/common.js}" type="text/javascript"></script>
    <script th:src="@{/script/user.js}" type="text/javascript"></script>
    <script th:src="@{/layui/layer/layer.js}" type="text/javascript"></script>
    <link rel="stylesheet" th:href="@{/css/fenye.css}"/>
</head>
<body>
<div th:replace="common/public::head"></div>
<!--个人中心-->
<div class="wrapper wbgcolor">
    <div class="w1200 personal">
        <!--<div class="credit-ad"><img height="96" th:src="@{/images/clist1.jpg}" width="1200"></div>-->
        <div class="personal-left" id="personal-left">
            <ul>
                <li class="pleft-cur"><span><a th:href="@{/per/index(option = 1)}"><i class="dot dot1"></i>账户总览</a></span></li>
                <li><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;" th:href="@{/cap/cap_List}">资金记录</a></span></li>
                <li><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;" th:href="@{/per/investlist(option = 1)}">投资记录</a></span>
                </li>
                <li><span><a style="font-size:14px;text-align:center;width:115px;padding-right:35px;" th:href="@{/per/prolist}">回款计划</a></span></li>
                <li><span><a th:href="@{/per/thirdparty}"><i class="dot dot02"></i>开通第三方</a> </span></li>
                <li><span><a th:href="@{/per/torecharge}"><i class="dot dot03"></i>充值</a></span></li>
                <li><span><a th:href="@{/per/towithdrawal}"><i class="dot dot04"></i>提现</a></span></li>
                <li style="position:relative;"><span> <a th:href="@{/per/toredenvelopes(state = 1)}"> <i class="dot dot06"></i> 我的红包 </a> </span></li>
                <li style="position:relative;"><span> <a th:href="@{/per/tomessages}"><i class="dot dot08"></i>系统信息 </a> </span></li>
                <li><span><a th:href="@{/setUser/toView}"><i class="dot dot09"></i>账户设置</a></span></li>
            </ul>
        </div>
        <div class="personal-main">
            <link rel="stylesheet" th:href="@{/css/fileupload.less.css}" type="text/css">
            <style type="text/css">
                .ui-fileupload-choose {
                    background: none;
                    width: 90px;
                    height: 90px;
                    border: 0px none;
                }

                .ui-fileupload-choose input {
                    width: 100%;
                    height: 100%;
                }

                .ui-icon {
                    background: none;
                    width: 0px;
                    height: 0px;
                }
            </style>
            <div class="pmain-profile">
                <div class="pmain-welcome">
                    <span class="fl">
                        <span id="outLogin">晚上好，</span>
                        <span th:text="${session.user.name} + '，'">tg_gpdt0139</span>
                        <span id="greetings">喝一杯下午茶，让心情放松一下~</span>
                    </span>
                    <span class="fr">
                        上次登录时间：
                        <span th:text="${session.user.logindate}">2015-09-11 14:05:07</span>
                    </span>
                </div>
                <div class="pmain-user">
                    <div class="user-head">
                        <span class="head-img" id="clickHeadImage" title="点击更换头像">
                            <form action="" method="post">
                                <input name="userPhotoUploadForm" type="hidden" value="userPhotoUploadForm">
                                <span id="userPhotoUploadForm:photo">
                                    <img alt="" style="width:88px;height:88px;z-index:0;" th:if="${session.user.face == null or session.user.face == ''}"
                                         th:src="@{/images/touxiang.png}">
                                    <img alt="" id="userPhotoUploadForm:photoImage" style="width:88px;height:88px;z-index:0;"
                                         th:if="${session.user.face != null or session.user.face != ''}" th:src="@{'/'+ ${session.user.face}}">
                                    <i class="headframe" style="z-index:0;"></i>-
                                    <div class="ui-fileupload ui-widget" id="userPhotoUploadForm:shangchuan-btn" style="z-index:0;">
                                        <div class="ui-fileupload-buttonbar ui-corner-top">
                                            <span class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left ui-fileupload-choose"
                                                  role="button">
                                                <span class="ui-button-icon-left ui-icon ui-c ui-icon-plusthick"></span>
                                                <span class="ui-button-text ui-c"></span>
                                                <input class="uploadHeadportrait" id="userPhotoUploadForm:shangchuan-btn_input"
                                                       name="userPhotoUploadForm:shangchuan-btn_input" style="z-index:0;display: none" type="file">
                                            </span>
                                        </div>
                                        <div class="ui-fileupload-content ui-widget-content ui-corner-bottom">
                                            <table class="ui-fileupload-files">
                                                <tbody></tbody>
                                            </table>
                                        </div>
                                    </div>
                                </span>
                                <input autocomplete="off" id="javax.faces.ViewState" name="javax.faces.ViewState" type="hidden"
                                       value="2696547217205030168:-301641994240890871">
                            </form>
                        </span>
                        <span class="head-icon">
                            <a th:href="@{/per/thirdparty}">
                                <i class="headiconbg headicon01" th:if="${thi == 0}" title="第三方资金账户未认证"></i>
                                <i class="headiconbg headicon1" th:if="${thi == 1}" title="第三方资金账户已认证"></i>
                            </a>

                            <a href="#">
                                <i class="headiconbg" id="phone"></i>
                            </a>
                            <a th:href="@{/per/tomessages}" th:if="${xx == 0}">
                                <i class="headiconbg headicon03"></i>
                            </a>
                            <a th:href="@{/per/tomessages}" th:if="${xx == 1}">
                                <i class="headiconbg headicon3"></i>
                            </a>
                        </span>
                    </div>
                    <div class="user-info user-info1">
                        <ul>
                            <li>
                                用户名
                                <input id="mon" th:value="${session.user.modificationTime}" type="hidden"/>
                                <span onclick="updname()" style="cursor: pointer;" th:text="${session.user.name}">tg_gpdt0139</span>
                            </li>
                            <li>安全级别
                                <span>
                                    <i class="safe-level" style="background-color: #0caffe;" th:if="${thi == 1}">
                                        <i class="onlevel"></i>
                                    </i>
                                    <i class="safe-level" th:if="${thi == 0}">
                                        <i class="onlevel"></i>
                                    </i>
                                </span>
                                <a th:href="@{/setUser/toView}" th:if="${thi == 0}">[低]</a>
                                <a th:href="@{/setUser/toView}" th:if="${thi == 1}">[高]</a>
                            </li>
                            <li th:if="${thi == 0}">
                                您还未开通第三方支付账户，请
                                <a class="pmain-log" th:href="@{/per/thirdparty}">立即开通</a>
                                以确保您的正常使用和资金安全。
                            </li>
                            <li th:if="${thi == 1}">
                                您已开通第三方支付账户！
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="pmain-money">
                    <ul>
                        <li class="none">
                            <span>
                                <em>账户总额</em>
                                <i class="markicon" id="zhze"></i>
                                <span class="arrow-show1" style="display:none;">可用余额+待收本息</span>
                                <span class="icon-show1" style="display:none;"></span>
                            </span>
                            <span class="truemoney">
                                <i class="f26 fb total_balance" th:if="${userstatus == 1 or userstatus == 2}">0.00 </i>
                                <i class="f26 fb total_balance" th:if="${userstatus == 3 or userstatus == 4 or userstatus == 5 or userstatus == 6}"
                                   th:text="${total_account_amount}">0.00 </i>
                                元
                            </span>
                        </li>
                        <li>
                            <span>
                                <em>待收本息</em>
                                <i class="markicon" id="dsbx"></i>
                                <span class="arrow-show2" style="display:none;">未到账的投资项目的本金、利息总额</span>
                                <span class="icon-show2" style="display:none;"></span>
                            </span>
                            <span class="truemoney">
                                <i class="f26 fb income_to_be_received" style="color: #0caffe"
                                   th:if="${userstatus == 1 or userstatus == 2 or userstatus == 4 or userstatus == 5}">0.00 </i>
                                <i class="f26 fb income_to_be_received" style="color: #0caffe" th:if="${userstatus == 3 or userstatus == 6}"
                                   th:text="${principal_and_interest_to_be_collected.i}">0.00 </i>
                                元
                            </span>
                        </li>
                        <li>
                            <span>
                                <em>累计收益</em>
                                <i class="markicon" id="ljsy"></i>
                                <span class="arrow-show3" style="display: none;">已到账的投资收益+未到账的投资收益</span>
                                <span class="icon-show3" style="display: none;"></span>
                            </span>
                            <span class="truemoney">
                                <i class="f26 fb c-pink accumulated_income" th:if="${userstatus == 1 or userstatus == 4}">0.00 </i>
                                <i class="f26 fb c-pink accumulated_income" th:if="${userstatus == 2 or userstatus == 3 or userstatus == 5 or userstatus == 6}"
                                   th:text="${cumulative_income.a}">0.00 </i>
                                元
                            </span>
                        </li>
                    </ul>
                </div>
            </div>
            <script type="text/javascript">
                $(function () {
                    $("#clickHeadImage").click(function () {
                        $(this).find('span').removeClass('ui-state-hover');
                        document.getElementById("userPhotoUploadForm:shangchuan-btn_input").click();
                    });
                    var safeLevel = "低";
                    if (safeLevel == "高") {
                        $(".pmain-user .user-info li .safe-level .onlevel").css("background-color", "#f1483c");
                    }

                    $("#clickHeadImage span").hover(function () {
                        $(this).removeClass('ui-state-hover');
                    });

                    var myDate = new Date();
                    var h = myDate.getHours();
                    if (h > 5 && h <= 8) {
                        $("#outLogin").html("早上好，");
                        $("#greetings").html("天明，亮起的不止是阳光，还有你的好心情~");
                    } else if (h > 8 && h <= 11) {
                        $("#outLogin").html("上午好，");
                        $("#greetings").html("让心融入世界，把温暖注入心房。上午快乐！");
                    } else if (h > 11 && h <= 14) {
                        $("#outLogin").html("中午好，");
                        $("#greetings").html("将问候的词句，寄存在光阴的驿站，与您共赴新的旅程~");
                    } else if (h > 14 && h <= 18) {
                        $("#outLogin").html("下午好，");
                        $("#greetings").html("喝一杯下午茶，让心情放松一下~");
                    } else {
                        $("#outLogin").html("晚上好，");
                        $("#greetings").html("如果我的祝福，能驱散您一天的疲倦，那么，就让它随着晚风吹进您的心谷吧！");
                    }
                });
                //]]>
            </script>
            <div class="pmain-connent" style="padding-bottom: 20px;">
                <div class="pmain-contab" id="pmain-contab">
                    <ul>
                        <a th:href="@{/per/index(option = 1)}">
                            <li id="pmain-contab1" th:class="${option == 1} ? on : ''">回款计划</li>
                        </a>
                        <a th:href="@{/per/index(option = 2)}">
                            <li id="pmain-contab2" th:class="${option == 2} ? on : ''">资金记录</li>
                        </a>
                        <a th:href="@{/per/index(option = 3)}">
                            <li id="pmain-contab3" th:class="${option == 3} ? on : ''">投资记录</li>
                        </a>
                        <li class="li-other"></li>
                    </ul>
                </div>
                <div class="pmain-conmain" id="pmain-conmain">
                    <div class="pmain-conmain1" th:if="${option == 1}">
                        <div class="pmain-contitle">
                            <span class="pmain-titledate" style="width: 260px;">计划回款时间</span>
                            <span class="pmain-titleproject" style="width: 260px;">项目</span>
                            <span class="pmain-titletype" style="width: 180px;">类型</span>
                            <span class="pmain-titlemoney" style="text-align: left">回款金额</span>
                        </div>
                        <ul style="float:left;">
                            <li style="width: 880px" th:each="pr:${pro.data}" th:if="${size != 0}">
                                <span class="pmain-titledate" style="width: 260px;" th:text="${#dates.format(pr.end_date, 'yyyy-MM-dd')}">2015-10-20</span>
                                <span class="pmain-titleproject" style="width: 260px;" th:text="${pr.pname}">宝马汽车借贷业务</span>
                                <span class="pmain-titletype" style="width: 180px;" th:if="${pr.ptype == 1}">新手标</span>
                                <span class="pmain-titletype" style="width: 180px;" th:if="${pr.ptype == 2}">推荐标</span>
                                <span class="pmain-titletype" style="width: 180px;" th:if="${pr.ptype == 3}">普通标</span>
                                <span class="pmain-titletype" style="width: 180px;" th:if="${pr.ptype == 4}">散标</span>
                                <span class="pmain-titlemoney" style="text-align: left" th:text="${pr.invest_money + pr.profit}">10.00</span>
                            </li>
                            <!--分页显示：-->
                            <div class="pagination" style="margin-top: 15px;width: 760px;" th:if="${size != 0}">
                                <a th:class="${pro.currPage == 1} ? 'disabled' : ''" th:href="@{/per/index(currPage = 1, option = 1)}" title="首页">首页</a>
                                <a th:class="${pro.currPage == 1} ? 'disabled' : ''" th:href="@{/per/index(currPage = ${pro.currPage - 1}, option = 1)}"
                                   title="上一页">上一页</a>

                                <a th:if="${pro.totalPage > 4 && pro.currPage > 4}" th:text="...">...</a>
                                <a th:class="${pagenum == pro.currPage} ? 'current' : ''"
                                   th:each="pagenum:${#numbers.sequence((pro.currPage > 4 ? (pro.currPage - 3) : 1), ((pro.currPage + 3) < pro.totalPage ? (pro.currPage + 3): pro.totalPage))}"
                                   th:href="@{/per/index(currPage = ${pagenum}, option = 1)}" th:text="${pagenum}">1</a>
                                <a th:if="${pro.totalPage > 4 && (pro.currPage + 3) < pro.totalPage}" th:text="...">...</a>

                                <a th:class="${pro.currPage == pro.totalPage} ? 'disabled' : ''"
                                   th:href="@{/per/index(currPage = ${pro.currPage + 1}, option = 1)}" title="下一页">下一页</a>
                                <a th:class="${pro.currPage == pro.totalPage} ? 'disabled' : ''"
                                   th:href="@{/per/index(currPage = ${pro.totalPage}, option = 1)}" title="尾页">尾页</a>
                            </div>
                            <div style=" width:760px;height:200px;padding-top:100px; text-align:center;color:#d4d4d4; font-size:16px;"
                                 th:if="${size == 0}">
                                <img height="60" th:src="@{/images/nondata.png}" width="60">
                                <br><br>
                                暂无回款计划
                            </div>
                        </ul>
                    </div>
                    <div class="pmain-conmain2" th:if="${option == 2}">
                        <div class="pmain-contitle">
                            <span class="pmain-titledate" style="width: 260px;">交易时间</span>
                            <span class="pmain-w100" style="width: 200px;">交易类型</span>
                            <span class="pmain-w120" style="width: 200px;text-align: left">交易金额</span>
                            <span class="pmain-w200" style="width: 190px;margin-left: 0px;">备注</span>
                        </div>
                        <ul style="float:left;">
                            <li style="width: 880px;" th:each="c:${cap.data}" th:if="${size != 0}">
                                <span class="pmain-titledate" style="width: 260px;" th:text="${c.trade_date}">2015-10-20</span>
                                <span class="pmain-title2 pmain-height" style="width: 200px;" th:if="${c.type == 1}">充值到余额</span>
                                <span class="pmain-title2 pmain-height" style="width: 200px;" th:if="${c.type == 2}">余额提现</span>
                                <span class="pmain-title2 pmain-height" style="width: 200px;" th:if="${c.type == 3}">购买项目</span>
                                <span class="pmain-title2 pmain-height" style="width: 200px;" th:if="${c.type == 4}">本金返回余额</span>
                                <span class="pmain-title2 pmain-height" style="width: 200px;" th:if="${c.type == 5}">利息返回余额</span>
                                <span class="pmain-title2 pmain-height" style="width: 200px;" th:if="${c.type == 6}">其他资金流动</span>
                                <span class="pmain-w120 pmain-money" style="width: 200px;text-align: left; height: auto;"
                                      th:text="${c.trade_money}">10.00</span>
                                <span class="pmain-w200" style="width: 190px;margin-left: 0px;" th:text="${c.remark}">备注</span>
                            </li>
                            <!--分页显示：-->
                            <div class="pagination" style="margin-top: 15px;width: 760px;" th:if="${size != 0}">
                                <a th:class="${cap.currPage == 1} ? 'disabled' : ''" th:href="@{/per/index(currPage = 1, option = 2)}" title="首页">首页</a>
                                <a th:class="${cap.currPage == 1} ? 'disabled' : ''" th:href="@{/per/index(currPage = ${cap.currPage - 1}, option = 2)}"
                                   title="上一页">上一页</a>

                                <a th:if="${cap.totalPage > 4 && cap.currPage > 4}" th:text="...">...</a>
                                <a th:class="${pagenum == cap.currPage} ? 'current' : ''"
                                   th:each="pagenum:${#numbers.sequence((cap.currPage > 4 ? (cap.currPage - 3) : 1), ((cap.currPage + 3) < cap.totalPage ? (cap.currPage + 3): cap.totalPage))}"
                                   th:href="@{/per/index(currPage = ${pagenum}, option = 2)}" th:text="${pagenum}">1</a>
                                <a th:if="${cap.totalPage > 4 && (cap.currPage + 3) < cap.totalPage}" th:text="...">...</a>

                                <a th:class="${cap.currPage == cap.totalPage} ? 'disabled' : ''"
                                   th:href="@{/per/index(currPage = ${cap.currPage + 1}, option = 2)}" title="下一页">下一页</a>
                                <a th:class="${cap.currPage == cap.totalPage} ? 'disabled' : ''"
                                   th:href="@{/per/index(currPage = ${cap.totalPage}, option = 2)}" title="尾页">尾页</a>
                            </div>
                            <div style=" width:760px;height:200px;padding-top:100px; text-align:center;color:#d4d4d4; font-size:16px;"
                                 th:if="${size == 0}">
                                <img height="60" th:src="@{/images/nondata.png}" width="60">
                                <br><br>
                                暂无资金记录
                            </div>
                        </ul>
                    </div>
                    <div class="pmain-conmain3" th:if="${option == 3}">
                        <div class="pmain-contitle">
                            <span class="pmain-titledate" style="width: 180px;">交易时间</span>
                            <span class="pmain-w210" style="width: 180px;">项目</span>
                            <span class="pmain-w80" style="width: 170px;text-align: left">状态</span>
                            <span class="pmain-whb200">我的投资</span>
                            <span class="pmain-whb110" style="width: 60px;text-align: left">我的收益</span>
                        </div>
                        <ul style="float:left;">
                            <li style="width: 880px;" th:each="in:${inv.data}" th:if="${size != 0}">
                                <span class="pmain-titledate" style="width: 180px;"
                                      th:text="${#dates.format(in.invest_date, 'yyyy-MM-dd HH:mm:ss')}">2015-10-20</span>
                                <span class="pmain-w210" style="width: 180px;" th:text="${in.name}">债权转让</span>
                                <span class="pmain-titletype" style="width: 170px;text-align: left" th:if="${in.status == 1}">投标中</span>
                                <span class="pmain-titletype" style="width: 170px;text-align: left" th:if="${in.status == 2}">回款中</span>
                                <span class="pmain-titletype" style="width: 170px;text-align: left" th:if="${in.status == 3}">已结束</span>
                                <span class="pmain-w80 pmain-money" style="height: auto;" th:text="${in.invest_money}">10.00</span>
                                <span class="pmain-whb200 pmain-money" style="width: 175px;text-align: right;height: auto;" th:text="${in.profit}">10.00</span>
                            </li>
                            <!--分页显示：-->
                            <div class="pagination" style="margin-top: 15px;width: 760px;" th:if="${size != 0}">
                                <a th:class="${inv.currPage == 1} ? 'disabled' : ''" th:href="@{/per/index(currPage = 1, option = 3)}" title="首页">首页</a>
                                <a th:class="${inv.currPage == 1} ? 'disabled' : ''" th:href="@{/per/index(currPage = ${inv.currPage - 1}, option = 3)}"
                                   title="上一页">上一页</a>

                                <a th:if="${inv.totalPage > 4 && inv.currPage > 4}" th:text="...">...</a>
                                <a th:class="${pagenum == inv.currPage} ? 'current' : ''"
                                   th:each="pagenum:${#numbers.sequence((inv.currPage > 4 ? (inv.currPage - 3) : 1), ((inv.currPage + 3) < inv.totalPage ? (inv.currPage + 3): inv.totalPage))}"
                                   th:href="@{/per/index(currPage = ${pagenum}, option = 3)}" th:text="${pagenum}">1</a>
                                <a th:if="${inv.totalPage > 4 && (inv.currPage + 3) < inv.totalPage}" th:text="...">...</a>

                                <a th:class="${inv.currPage == inv.totalPage} ? 'disabled' : ''"
                                   th:href="@{/per/index(currPage = ${inv.currPage + 1}, option = 3)}" title="下一页">下一页</a>
                                <a th:class="${inv.currPage == inv.totalPage} ? 'disabled' : ''"
                                   th:href="@{/per/index(currPage = ${inv.totalPage}, option = 3)}" title="尾页">尾页</a>
                            </div>
                            <div style=" width:760px;height:200px;padding-top:100px; text-align:center;color:#d4d4d4; font-size:16px;"
                                 th:if="${size == 0}">
                                <img height="60" th:src="@{/images/nondata.png}" width="60">
                                <br><br>
                                暂无投资记录
                            </div>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<!--网站底部-->
<div class="ft" id="footer">
    <div th:replace="common/public::footer"></div>
</div>
<script type="text/javascript">
    //js判断是否为手机登录
    if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
        $('#phone').addClass('headicon2');
    } else {
        $('#phone').addClass('headicon02');
    }


    //修改头像
    $('.uploadHeadportrait').change(function () {
        let $this = $(this);  //选中当前对象
        let file = $this[0].files[0];  //选中当前输入框下标为0的文件，选中第一个文件。
        let requestParam = new FormData();  //获取文件
        requestParam.append("file", file);
        let zzz = layer.load();  //实例等待防触层
        $.ajax({
            url: '[[@{/per/upload-headportrait}]]',
            type: 'POST',
            processData: false,
            contentType: false,
            data: requestParam,
            dataType: 'json',
            success: function (data) {
                layer.close(zzz);  //关闭等待防触层
                if (data) {
                    layer.msg('头像修改成功', {time: 1000, icon: 1}, function () {
                        //刷新页面
                        location.reload();
                    });
                } else {
                    let i = layer.msg('头像修改失败，请联系管理员！', {icon: 3});
                    layer.style(i, {
                        'background-color': 'lightgrey'
                    })
                }
            }
        });
    });

    //更改用户名
    function updname() {
        var mon = $("#mon").val().trim();
        layer.prompt({title: '请您输入需要更改的用户名', formType: 0}, function (texts, index) {
            if (texts == "" | texts == null) {
                layer.msg('用户名不能为空！', {
                    icon: 2
                });
            } else if (!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(texts)) {
                layer.msg('用户名只能以字母开头，且只能由字母、数字、下划线组成', {
                    icon: 2
                });
            } else if (texts.length < 6 || texts.length > 14) {
                layer.msg('用户名为6-14为字符', {
                    icon: 2
                });
            } else {
                let zzz = layer.load();  //实例等待防触层
                $.ajax({
                    url: '[[@{/user/seluser}]]',
                    type: 'post',
                    async: false,
                    data: {name: texts},
                    dataType: 'json',
                    success: function (data) {
                        if (data == 1) {  //用户存在时
                            layer.close(zzz);  //关闭等待防触层
                            layer.msg('用户名已存在', {
                                icon: 5
                            });
                        } else if (data == 0) {
                            if (mon == 2) {
                                layer.close(zzz);  //关闭等待防触层
                                layer.msg('您本月已修改一次用户名', {
                                    icon: 5
                                });
                            } else if (mon == 1) {
                                $.ajax({
                                    url: '[[@{/per/updname}]]',
                                    type: 'post',
                                    async: false,
                                    data: {name: texts},
                                    dataType: 'json',
                                    success: function (data2) {
                                        layer.close(zzz);  //关闭等待防触层
                                        if (data2 == 1) {
                                            layer.close(index);  //关闭弹出层
                                            layer.msg('更改用户名成功！', {time: 1000, icon: 1}, function () {
                                                location.reload()
                                            });
                                        } else if (data2 == 0) {
                                            layer.close(index);  //关闭弹出层
                                            layer.msg('系统错误，请联系管理员！', {
                                                icon: 3
                                            });
                                        }
                                    }
                                });
                            }
                        }
                    }
                });
            }
        });
    }

    //转换格式
    var total_balance = $(".total_balance").text();  //账户总额
    $(".total_balance").text((parseFloat(total_balance)).toFixed(2));
    var income_to_be_received = $(".income_to_be_received").text();  //待收本息
    $(".income_to_be_received").text((parseFloat(income_to_be_received)).toFixed(2));
    var accumulated_income = $(".accumulated_income").text();  //累积收益
    $(".accumulated_income").text((parseFloat(accumulated_income)).toFixed(2))
</script>
</body>
</html>
